﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects.BO_GetObjects;
using System.Data;

public partial class Controls_VoteResult : Admin_Controls_Base
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadData();
        }
    }

    protected void loadData()
    {
        DataTable objDT = BO_portal_survey_questions.SelectWithPaged(1, 1, 1);
        if (objDT.Rows.Count > 0)
        {
            //strQuestion.InnerText = objDT.Rows[0]["QUESTION_TEXT"].ToString();
            //hdfID.Value = objDT.Rows[0]["QUESTION_ID"].ToString();
            //objDT = BO_portal_survey_answers.SelectAllByQuestion(1, Convert.ToInt32(objDT.Rows[0]["QUESTION_ID"]));
            //rptServey.DataSource = objDT;
            //rptServey.DataBind();
        }
    }

    //protected string loadTotalPercent(int answer_id, int question_id)
    //{
    //    int iTotalVote = getTotalResult(answer_id);
    //    int iTotalQuestion = getTotalByQuestion(question_id);
    //    return iTotalVote + "(" + 100 / iTotalQuestion * iTotalVote + "%)" + iTotalQuestion + "/" + iTotalVote;
    //}

    //protected int getTotalResult(int answer_id)
    //{
    //    string strResult = BO_portal_survey_results.SelectTotal(answer_id);
    //    return Convert.ToInt32(strResult);
    //}
    //protected int getTotalByQuestion(int question_id)
    //{
    //    string strResult = BO_portal_survey_results.SelectTotal(question_id);
    //    return Convert.ToInt32(strResult);
    //}

}